package net.loyin.app.ctrl.front;

import net.loyin.annotation.ControllerBind;
import net.loyin.app.model.Article;
import net.loyin.app.model.ArticleCate;
import net.loyin.app.model.NavMenu;
import org.apache.commons.lang.StringUtils;

/**
 * 前端首页
 * Created by loyin on 16/1/12.
 */
@ControllerBind(route = TeseCtrl.base)
public class TeseCtrl extends FrontBaseCtrl {
    public static final String base = "/tese";

    public void index() {
        String para=this.getPara(0);
        if(StringUtils.isNotBlank(para)) {
            String jumpUrl = NavMenu.dao.hasJumpUrl(base+"/"+ para, 1);
            if (StringUtils.isNotBlank(jumpUrl)) {
                this.forwardAction(jumpUrl);
            }
        }
    }
    public void view(){
        this.setNavInfo();
        String id = this.getPara(0);
        if (StringUtils.isNotBlank(id)) {
            this.setAttr("po", Article.dao.findById(id));
        }
    }
}
